import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { MainComponent } from "./main/main.component";
import { LoginComponent } from "./login/login.component";
import { CategoryComponent } from "./category/category.component";
import { DetailComponent} from "./detail/detail.component";

const appRoutes : Routes = [
    { path: '', redirectTo : '/main', pathMatch: 'full'},
    { path: 'main', component: MainComponent },
    { path: 'login', component: LoginComponent },
    { path: 'cate', component: CategoryComponent },
    { path: 'detail', component: DetailComponent }
];

@NgModule({
    imports: [RouterModule.forRoot(appRoutes)],
    exports: [RouterModule]
})

export class AppRoutingModule { }